Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

Re: Creating a Web Service consumer

Simon,

Thank you for your post and your recommendation. We resolved our problem, by essentially doing what you recommended. A code sample of our solution is shown below.


Thanks again,
KC


Code Sample:
Declarations
Dim gSession As NotesSession
Dim profsession As NotesSession
Dim profdb As NotesDatabase
Dim gDb As NotesDatabase
Dim profdoc As NotesDocument
Dim globalprofile As NotesDocument
Dim gUserProfile As NotesDocument
Dim profnam As NotesName

Dim client As Variant

Dim curid As String
Dim curdept As String
Dim curdeptvp As String
Dim curdeptsrvp As String
Dim curdepartmentmanagerid As String
Dim curdepartmentvpid As String
Dim curdepartmentsrvpid As String

Dim sessionXML As NotesSession
Dim gDomParser As NotesDOMParser
Dim domDoc As NotesDOMDocumentNode
Dim nodelist As NotesDOMNodeList
Dim parent As NotesDOMNode, child As NotesDOMNode
Dim value As String
Dim j As Integer, k As Integer
Dim qSoapRequest2 As String, qSoapResponse2 As String

Dim tempunderid As Variant
Dim tempunder1id As Variant
Dim undername As String
Dim under1name As String
Dim tempundername As String
Dim tempunder1name As String

Dim temp() As Variant
Dim tempcount As Integer
Dim tempA() As Variant
Dim tempAcount As Integer
Dim temp1() As Variant
Dim temp1count As Integer
Dim temp1A() As Variant
Dim temp1Acount As Integer

Dim adminid()As Variant
Dim adminidcount As Integer
Dim adminidexec()As Variant
Dim adminidexeccount As Integer

Dim prof_session As NotesSession
Dim prof_db As NotesDatabase
Dim prof_profdoc As NotesDocument
Dim profileswitch As String

'Profile Forms
Const gUserSettings = "UserSettings"


Sub Initialize
Set gSession = New NotesSession
Set gDb = gSession.CurrentDatabase
Set gUserProfile = gDb.GetProfileDocument(gUserSettings, gSession.UserName)
End Sub


Sub GetCurUserIDandDept()
On Error Resume Next

Dim rep1 As String, rep2 As String
Dim tmpResponse As String
Dim value As String
Dim j As Integer, k As Integer
Dim gItem As New NotesItem(gUserProfile, "DirectReportsIds", "")

'Get handle to DirectReportsIds and reset values
gItem.Values = ""

'Create Soap Client
On Error Goto errorHandler

Dim objHttp As Variant
Set objHttp = CreateObject("MSXML2.XMLHTTP.6.0")

qSoapRequest2 = {<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:DefaultNamespace">
<soapenv:Header/>
<soapenv:Body>
<urn:GETEMPLOYEEID soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<NOTESNAME xsi:type="xsd:string">} & profnam.Canonical & {</NOTESNAME>
</urn:GETEMPLOYEEID>
</soapenv:Body>
</soapenv:Envelope>}

objHttp.open "POST", globalprofile.Endpoint1(0) + "?OpenWebService", False
objHttp.setRequestHeader "Content-Type", "text/xml; charset=UTF-8"
objHttp.send(qSoapRequest2)

qSoapResponse2 = objHttp.responseXML.xml

objHttp = Null

rep1 = Replace(qSoapResponse2, "&lt;", "<")
rep2 = Replace(rep1, "&gt;", ">")
tmpResponse = rep2

'Call web service and parse response
Set gDomParser = gSession.createDOMParser(tmpResponse)
Call gDomParser.Parse
Set domDoc = gDomParser.Document
Set nodeList = domDoc.GetElementsByTagName("Employee")

'Error handling if nodeList is empty
If (nodeList.NumberOfEntries = 0) Then
Msgbox "No employee data was found.", 0, "Error"
End 'Stop all processing immediately
End If
For j = 1 To nodeList.NumberOfEntries
Set parent = nodeList.GetItem(j)
For k = 1 To parent.NumberOfChildNodes
If k = 1 Then
Set child = parent.FirstChild
Else
Set child = child.NextSibling
End If
'Allow for null values
If child.FirstChild.IsNull Then
value = ""
Else
value = child.FirstChild.NodeValue
End If
Select Case child.NodeName
Case "empid"
curid= value
Case "deptid"
curdept= value
End Select
Next k
Next j

errorHandler:
objHttp = Null
Resume Next
End Sub


Feedback response number WEBB86GRWY created by ~Rebecca Bregerokonyakoi on 06/16/2010

Using of SOAP and/or Web Service Co... (~Paul Zekfreest... 11.Feb.10)
. . Using MSSOAP with Notes 8.5.1 on Wi... (~Rebecca Breger... 9.Jun.10)
. . Creating a Web Service consumer. (~Rex Pretoolito... 10.Jun.10)
. . . . Re: Creating a Web Service consumer... (~Rebecca Breger... 16.Jun.10)
. . . . . . Thanks! (~Anita Cisgerot... 9.Aug.11)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS